package com.moneywelcome.orderfacade;

import com.moneywelcome.annnotation.RedisAnnotation;
import com.moneywelcome.orderfacade.dto.ProfitDayDto;
import com.moneywelcome.orderfacade.dto.SubscribeOrderDto;
import com.moneywelcome.orderfacade.dto.UserFinancialDto;
import com.moneywelcome.orderfacade.vo.OrderPageVo;
import com.moneywelcome.orderfacade.vo.ProfitDayVo;
import com.moneywelcome.orderfacade.vo.UserFinancialVo;
import com.moneywelcome.results.PageResult;
import com.moneywelcome.results.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.io.IOException;

@FeignClient(
        contextId="financialApi",//服务名字
        value = "invest-order" // 区分不同client
)
public interface FinancialApi {
  @PostMapping("/queryById")
  Result<UserFinancialDto> queryById(@RequestParam("financialId") Long financialId);

  @PostMapping("/queryByGoldId")
    Result<UserFinancialDto> queryByGoldId(@RequestParam("goldId")Integer goldId,@RequestParam("userId")Integer userId);

    @PostMapping("/financialQuery")
  Result<PageResult<UserFinancialDto>> financialQuery(@RequestBody OrderPageVo orderPageVo);
  @PostMapping("save")
    Result<UserFinancialDto> saveFinancial(@RequestBody UserFinancialVo userFinancialVo);
  @PostMapping("updateShares")
  Result<UserFinancialDto> updateShares(@RequestParam("financialId") Long financialId,@RequestParam("shares") Double shares);
  @PostMapping("updateRevenue")
  Result<UserFinancialDto> updateRevenue() throws IOException;
  @PostMapping("/saveProfit")
  Result<ProfitDayDto> saveProfit(@RequestBody ProfitDayVo profitDayVo);
}
